sanitize IRR
Validates and sanitizes a pre-calculated IRR value.
nullwill return Double.NaNDouble.NaN and infinite numbers will be returned unchanged.
Near-zero values (
|IRR| < [EPSILON]) are returned as zero.Negative zero values are returned normalized as (positive) zero values.
Extremely large values (≥ Double.MAX_VALUE) are returned as Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
If maxIRR is supplied and the absolute value exceeds it, the result is also returned as Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
Return
A validated and sanitized IRR value. (note: 'sanitized' result(s) will always survive kotlin Double unboxing to java double, whereas the original raw IRR may contain null)
Since
MD2027
Parameters
The calculated IRR value to validate (as a decimal, e.g. 0.15 = 15%).
Optional (absolute) upper bound considered valid for IRR. If null, no bound is enforced. Default is MAX_SENSIBLE_IRR.